﻿@using PTop.Code
@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script src="~/Content/js/uploadImage/jquery.ui.widget.min.js"></script>
<script src="~/Content/js/uploadImage/jquery.iframe-transport.min.js"></script>
<script src="~/Content/js/uploadImage/jquery.fileupload.min.js"></script>
<link href="~/Content/js/uploadImage/jquery.fileupload-image.css" rel="stylesheet" />
<script src="~/Content/js/uploadImage/jquery.fileupload-image-extend.js"></script>
<script>
    var keyValue = $.request("keyValue");
    $(function () {
        //initControl();
        if (!!keyValue) {
            $.ajax({
                url: "/Biz/Message/GetFormJson",
                data: { keyValue: keyValue },
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#form1").formSerialize(data);

                    $("#F_ImgList").bindUpload({
                        limitCount: 3,
                        type: "LostProperty",
                        //host: "@(Configs.GetValue("WapHost"))",
                        readonly: true
                    });
                }
            });
        }
    });
    function initControl() {
        $("#F_OrganizeId").bindSelect({
            url: "/SystemManage/Organize/GetTreeSelectJson",
        });
    }
    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }
        $.submitForm({
            url: "/Biz/Message/SubmitForm?keyValue=" + keyValue,
            param: $("#form1").formSerialize(),
            success: function () {
                $.currentWindow().$("#gridList").trigger("reloadGrid");
            }
        });
    }
</script>

<form id="form1">
    <div style="padding-top: 20px; margin-right: 20px;">
        <table class="form">

            <tr>
                <th class="formTitle">姓名</th>
                <td class="formValue">
                    <input id="F_Name" name="F_Name" type="text" class="form-control" placeholder="" readonly="readonly" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">电话</th>
                <td class="formValue">
                    <input id="F_Phone" name="F_Phone" type="text" class="form-control" placeholder="" readonly="readonly" />
                </td>
            </tr>
            @*<tr>
                <th class="formTitle">标题</th>
                <td class="formValue">
                    <input id="F_Title" name="F_Title" type="text" class="form-control" placeholder="" readonly="readonly" />
                </td>
            </tr>*@
            <tr>
                <th class="formTitle">内容</th>
                <td class="formValue">
                    <textarea id="F_Message" name="F_Message" class="form-control" rows="5" readonly="readonly"></textarea>
                </td>
            </tr>
            <tr>
                <th class="formTitle">图片</th>
                <td class="formValue">
                    <input id="F_ImgList" name="F_ImgList" type="text" class="form-control required" placeholder="" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">回复</th>
                <td class="formValue">
                    <textarea id="F_Response" name="F_Response" class="form-control" rows="5"></textarea>
                </td>
            </tr>
            <tr>
                <th class="formTitle">状态</th>
                <td class="formValue">
                    <select id="F_State" name="F_State" class="form-control required">
                        <option value="0">未处理</option>
                        <option value="1">已处理</option>
                    </select>
                </td>
            </tr>
        </table>
    </div>
</form>